blktap: Fix unaligned access to blktap/tapdisk message payloads.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Wed, 1 Aug 2007 08:11:08 +0000 (09:11 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Wed, 1 Aug 2007 08:11:08 +0000 (09:11 +0100)
Signed-off-by: Keir Fraser <keir@xensource.com>
tools/blktap/lib/blktaplib.h

index 0e2a9109b19bbfcf3934bfcc8c9d282e04b401ce..9d17c6152ecaf0f85e0e1232092aec5b3e86960b 100644 (file)
@@ -169,12 +169,14 @@ typedef struct image {
        unsigned int info;
 } image_t;
 
+/* 16-byte message header, immediately followed by message payload. */
 typedef struct msg_hdr {
-       uint16_t    type;
+       uint16_t   type;
        uint16_t   len;
        uint16_t   drivertype;
        uint16_t   cookie;
        uint8_t    readonly;
+       uint8_t    pad[7];
 } msg_hdr_t;
 
 typedef struct msg_newdev {